//
//  GMHblockOneTableViewCell.m
//  
//
//  Created by 郭明皓 on 15/10/22.
//
//

#import "GMHblockOneTableViewCell.h"
#define WIDTH self.backViews.frame.size.width
#define HEIGHT self.backViews.frame.size.height
@implementation GMHblockOneTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)dealloc
{
    [_titleImageview release];
    [_leftImageview release];
    [_rightImageview release];
    [_backViews release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if ( self) {
        [self create];
    }
    return  self;
}

- (void)create
{
    self.backViews = [[UIView alloc]init];
    [self.contentView addSubview:self.backViews];
    [self.backViews release];
    
    self.titleImageview = [[UIImageView alloc]init];
    [self.backViews addSubview:self.titleImageview];
    [self.titleImageview release];
    
    self.rightImageview = [[UIImageView alloc]init];
    [self.backViews addSubview: self.rightImageview];
    [self.rightImageview release];
    
    self.leftImageview = [[UIImageView alloc]init];
    [self.backViews addSubview: self.leftImageview];
    [self.leftImageview release];
    
    self.button = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.backViews addSubview:self.button];
    
    
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.backViews.frame = CGRectMake(5, 5, self.contentView.frame.size.width - 10, self.contentView.frame.size.height - 10);
    self.titleImageview.frame = CGRectMake(0, 0, WIDTH, HEIGHT / 2);
    self.leftImageview.frame = CGRectMake(0, HEIGHT / 2, WIDTH / 2, HEIGHT / 3);
    self.button.frame = CGRectMake(0, HEIGHT / 2 + HEIGHT / 3, WIDTH, HEIGHT / 6);
}

@end
